package test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import test.dto.FileUploadRequestDTO;
import test.orther.SliceUploadStrategy;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : example
 * @ Author: XuLeHuang
 * @ Date: 2022/6/8 22:52
 * @ Description:
 */
@Controller
@RequestMapping("/")
public class SliceUploadController {
    @Autowired
    private SliceUploadStrategy sliceUploadStrategy;

    @RequestMapping("/sliceUploadPage")
    public String sliceUploadPage() {
        return "/sliceUpload";
    }

    @RequestMapping("save")
    @ResponseBody
    public void upload( FileUploadRequestDTO param) throws Exception {
        sliceUploadStrategy.sliceUpload(param);
    }
    /*@RequestMapping("save")
    @ResponseBody
    public void upload(String name,
                       String md5,
                       Long size,
                       Integer chunks,
                       Integer chunk,
                       @RequestParam("file") MultipartFile multipartFile) throws Exception {
       return;
    }*/
}
